home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 February: Tool Chest / Dev.CD Feb 94.toast / Tool Chest / Development Platforms / MPW Related / MPW Interfaces / CIncludes / PictUtil.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-09-17  |  4.9 KB  |  141 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        PictUtil.h
  3.  
  4.     Copyright:    © 1983-1993 by Apple Computer, Inc.
  5.                 All rights reserved.
  6.  
  7.     Version:    System 7.1 for ETO #11
  8.     Created:    Tuesday, March 30, 1993 18:00
  9.  
  10. */
  11.  
  12. #ifndef __PICTUTIL__
  13. #define __PICTUTIL__
  14.  
  15. #ifndef __TYPES__
  16. #include <Types.h>
  17. #endif
  18.  
  19. #ifndef __PALETTES__
  20. #include <Palettes.h>
  21. #endif
  22.  
  23.  
  24. enum {
  25.  
  26.  
  27. /* verbs for the GetPictInfo, GetPixMapInfo, and NewPictInfo calls */
  28.  
  29. #define returnColorTable ((short) 0x0001)
  30. #define returnPalette ((short) 0x0002)
  31. #define recordComments ((short) 0x0004)
  32. #define recordFontInfo ((short) 0x0008)
  33. #define suppressBlackAndWhite ((short) 0x0010)
  34.  
  35. /* color pick methods */
  36.  
  37.  systemMethod = 0,                    /*system color pick method*/
  38.  popularMethod = 1,                    /*method that chooses the most popular set of colors*/
  39.  medianMethod = 2,                    /*method that chooses a good average mix of colors*/
  40.  
  41. /* color bank types */
  42.  ColorBankIsCustom = -1,
  43.  ColorBankIsExactAnd555 = 0,
  44.  ColorBankIs555 = 1
  45. };
  46.  
  47. typedef long PictInfoID;
  48.  
  49. struct CommentSpec {
  50.  short count;                        /* number of occurrances of this comment ID */
  51.  short ID;                            /* ID for the comment in the picture */
  52. };
  53.  
  54. typedef struct CommentSpec CommentSpec;
  55. typedef CommentSpec *CommentSpecPtr, **CommentSpecHandle;
  56.  
  57. struct FontSpec {
  58.  short pictFontID;                    /* ID of the font in the picture */
  59.  short sysFontID;                    /* ID of the same font in the current system file */
  60.  long size[4];                        /* bit array of all the sizes found (1..127) (bit 0 means > 127) */
  61.  short style;                        /* combined style of all occurrances of the font */
  62.  long nameOffset;                    /* offset into the fontNamesHdl handle for the font’s name */
  63. };
  64.  
  65. typedef struct FontSpec FontSpec;
  66. typedef FontSpec *FontSpecPtr, **FontSpecHandle;
  67.  
  68. struct PictInfo {
  69.  short version;                        /* this is always zero, for now */
  70.  long uniqueColors;                    /* the number of actual colors in the picture(s)/pixmap(s) */
  71.  PaletteHandle thePalette;            /* handle to the palette information */
  72.  CTabHandle theColorTable;            /* handle to the color table */
  73.  Fixed hRes;                        /* maximum horizontal resolution for all the pixmaps */
  74.  Fixed vRes;                        /* maximum vertical resolution for all the pixmaps */
  75.  short depth;                        /* maximum depth for all the pixmaps (in the picture) */
  76.  Rect sourceRect;                    /* the picture frame rectangle (this contains the entire picture) */
  77.  long textCount;                    /* total number of text strings in the picture */
  78.  long lineCount;                    /* total number of lines in the picture */
  79.  long rectCount;                    /* total number of rectangles in the picture */
  80.  long rRectCount;                    /* total number of round rectangles in the picture */
  81.  long ovalCount;                    /* total number of ovals in the picture */
  82.  long arcCount;                        /* total number of arcs in the picture */
  83.  long polyCount;                    /* total number of polygons in the picture */
  84.  long regionCount;                    /* total number of regions in the picture */
  85.  long bitMapCount;                    /* total number of bitmaps in the picture */
  86.  long pixMapCount;                    /* total number of pixmaps in the picture */
  87.  long commentCount;                    /* total number of comments in the picture */
  88.  long uniqueComments;                /* the number of unique comments in the picture */
  89.  CommentSpecHandle commentHandle;    /* handle to all the comment information */
  90.  long uniqueFonts;                    /* the number of unique fonts in the picture */
  91.  FontSpecHandle fontHandle;            /* handle to the FontSpec information */
  92.  Handle fontNamesHandle;            /* handle to the font names */
  93.  long reserved1;
  94.  long reserved2;
  95. };
  96.  
  97. typedef struct PictInfo PictInfo;
  98. typedef PictInfo *PictInfoPtr, **PictInfoHandle;
  99.  
  100.  
  101. #ifdef __cplusplus
  102. extern "C" {
  103. #endif
  104. pascal OSErr GetPictInfo(PicHandle thePictHandle,
  105.                          PictInfo *thePictInfo,
  106.                          short verb,
  107.                          short colorsRequested,
  108.                          short colorPickMethod,
  109.                          short version)
  110.  = {0x303C,0x0800,0xA831}; 
  111. pascal OSErr GetPixMapInfo(PixMapHandle thePixMapHandle,
  112.                            PictInfo *thePictInfo,
  113.                            short verb,
  114.                            short colorsRequested,
  115.                            short colorPickMethod,
  116.                            short version)
  117.  = {0x303C,0x0801,0xA831}; 
  118. pascal OSErr NewPictInfo(PictInfoID *thePictInfoID,
  119.                          short verb,
  120.                          short colorsRequested,
  121.                          short colorPickMethod,
  122.                          short version)
  123.  = {0x303C,0x0602,0xA831}; 
  124. pascal OSErr RecordPictInfo(PictInfoID thePictInfoID,
  125.                             PicHandle thePictHandle)
  126.  = {0x303C,0x0403,0xA831}; 
  127. pascal OSErr RecordPixMapInfo(PictInfoID thePictInfoID,
  128.                               PixMapHandle thePixMapHandle)
  129.  = {0x303C,0x0404,0xA831}; 
  130. pascal OSErr RetrievePictInfo(PictInfoID thePictInfoID,
  131.                               PictInfo *thePictInfo,
  132.                               short colorsRequested)
  133.  = {0x303C,0x0505,0xA831}; 
  134. pascal OSErr DisposPictInfo(PictInfoID thePictInfoID)
  135.  = {0x303C,0x0206,0xA831}; 
  136. #ifdef __cplusplus
  137. }
  138. #endif
  139.  
  140. #endif
  141.